﻿<controls:ChildWindow xmlns:my="clr-namespace:caedisi.Views.Controls"   xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="caedisi.Views.Controls.VertexProperties"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="Auto" 
           Title="Cell Properties"
                      DataContext="{Binding RelativeSource={RelativeSource Self}}" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignWidth="524">
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Margin="0,0,0,10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <sdk:Label Grid.Row="0" Grid.Column="0" Content="Label" />
            <sdk:Label Grid.Row="0" Grid.Column="2" Content="Current Iteration"/>            
            <sdk:Label Grid.Row="1"  Grid.Column="0" Content="Description"/>            
            <sdk:Label Grid.Row="2"  Content="Current Status"/>
            <sdk:Label Grid.Row="2"  Grid.Column="2" Content="Immunity"/>            
            
            <TextBox Grid.Column="1" Width="100" HorizontalAlignment="Left" Text="{Binding Path=CurrentCell.Label, Mode=TwoWay}" IsEnabled="False"/>
            <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=CurrentCell.SimulationIterationItem.Step, Mode=TwoWay}" IsEnabled="False"/>
            <TextBox Grid.Row="1"  Grid.Column="1" Grid.ColumnSpan="3"  Text="{Binding Path=CurrentCell.Description, Mode=TwoWay}"/>
            <TextBox Grid.Row="2" Grid.Column="3"  Text="{Binding Path=CurrentCell.SimulationIterationItem.ImmunityTimerValue, Mode=TwoWay}" IsEnabled="False"/>
            <my:BasicCellControl Grid.Column="1" Grid.Row="2" SelectedCellStateTypeId="{Binding Path=CurrentCell.SimulationIterationItem.CellStateTypeId, Mode=TwoWay}" HorizontalAlignment="Left"  x:Name="basicCellControl1"  Height="25" Width="29" IsEnabled="False"/>
        </Grid>

        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <sdk:Label Grid.Row="0" Content="Transition rules that cause this state"/>
            <CheckBox  Grid.Row="1" Content="Deterministic" IsEnabled="False" IsChecked="{Binding Path=CurrentCell.SimulationIterationItem.IsDeterministic, Mode=TwoWay}"/>
            <ScrollViewer Grid.Row="2" Name="rules" >
                <ListBox  x:Name="stackOfRules" ItemsSource="{Binding Path=CurrentCell.SimulationIterationItem.TransitionRulesCause, Mode=TwoWay}"  HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <my:TransitionRuleControl CurrentTransitionRule="{Binding }"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </ScrollViewer>
            
        </Grid>
        <Button Grid.Row="2" x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" />
    </Grid>

</controls:ChildWindow>